package v1

import "github.com/gogf/gf/v2/frame/g"

type ManyToManyReq struct {
	g.Meta `path:"/manyToMany" tags:"关系查询" method:"get" summary:"多对多查询"`
}
type ManyToManyRes struct {
	Content []*Boyfriend `json:"content"`
}

// Boyfriend 主表
type Boyfriend struct {
	g.Meta              `orm:"table:boyfriend"`
	BoyfriendId         uint64                 `json:"boyfriendId" dc:"男朋友表中主键id"`
	Name                string                 `json:"name"        dc:"男朋友名字"`
	Age                 int                    `json:"age"         dc:"年龄"`
	BoyfriendGirlfriend []*BoyfriendGirlfriend `json:"boyfriendGirlfriend" orm:"with:boyfriend_id=boyfriend_id"`
}

// BoyfriendGirlfriend 中间表
type BoyfriendGirlfriend struct {
	g.Meta `orm:"table:boyfriend_girlfriend"`
	//中间表中的主键id可以不要
	//Id           uint64          `json:"id"           dc:"这是中间表的主键id"`
	BoyfriendId  int64           `json:"boyfriendId"  dc:"注意这是boyfriend表中的主键id"`
	GirlfriendId int64           `json:"girlfriendId" dc:"注意这是girlfriend表中的主键id"`
	Girlfriendss []*Girlfriendss `json:"girlfriendss" orm:"with:id=girlfriend_id"`
}

// Girlfriendss 主表
type Girlfriendss struct {
	g.Meta       `orm:"table:girlfriend"`
	Id           uint64 `json:"id"           dc:"女朋友表的主键id"`
	Name         string `json:"name"         dc:"女朋友名字"`
	Age          int    `json:"age"          dc:"年龄"`
	GirlfriendId uint64 `json:"girlfriendId" dc:"关联男朋友表"`
}
